package com.oop.demo;

import java.util.Scanner;

/**
 * @author miao
 * @version 1.0
 * @date 2025/4/14 17:16
 * @description
 */
public class Test5 {
    public static void main(String[] args) {
        //键盘录入一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入密码：");
        String str = sc.nextLine();
        //检验密码是否合法，至少九个字符，至少两个大写字符，包含字母和数字
        if (str.length() >= 9) {
            int count = 0;
            int count1 = 0;
            int count2 = 0;
            for (int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                if (c >= 'A' && c <= 'Z') {
                    count++;
                }
                if (c >= 'a' && c <= 'z') {
                    count1++;
                }
                if (c >= '0' && c <= '9') {
                    count2++;
                }
                if (count>=2&&count1>=1&&count2>=1){
                    System.out.println("true");
                }else {
                    System.out.println("false");
                }


            }
        }

    }
}
